package com.tg.service.event;

import org.springframework.context.ApplicationEvent;

/**
 * Created by linzc on 2018/9/19.
 */
public class MessageEvent extends ApplicationEvent {

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public MessageEvent(Object source) {
        super(source);
        name = source.toString();
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"name\":\"").append(name).append('\"');
        sb.append('}');
        sb.append(super.toString());
        return sb.toString();
    }
}

